package jflowmap.model.ontology;

import java.util.Collections;
import java.util.Set;

import jflowmap.model.ontology.interfaces.Named;

import com.google.common.collect.Sets;

public class SelectionDefinition implements Named {

	private final Set<Dimension> dimensions = Sets.newHashSet();
	private final Context context;
	private String name;
	
	SelectionDefinition(final Context context) {
		this.context = context;
	}
	
	public SelectionDefinition add (Dimension dimension) {
		dimensions.add(dimension);
		return this;
	}
	
	public SelectionDefinition named(String name) {
		this.name = name;
		return this;
	}
	
	@Override
	public String getName() {
		return name;
	}
	
	public Set<Dimension> getDimensions() {
		return Collections.unmodifiableSet(this.dimensions);
	}

	public SelectionDefinition add(DimensionCollection coll) {
		for (final Dimension dim: coll.get()) {
			this.add(dim);
		}
		
		return this;
	}
	
}
